package com.pan.design.pattern.behavioral.chainofresponsibility;

import org.apache.commons.lang.StringUtils;

/**
 * @author by panstark
 * @description
 * @notice
 * @date 2020/12/8
 */
public class CodeApprover extends Approver {


    @Override
    public void deploy(Course course) {

        if(StringUtils.isNotEmpty(course.getCode())){
            System.out.println(course.getName()+"含有代码,批准");
            if(approver != null){
                approver.deploy(course);
            }
        }else{
            System.out.println(course.getName()+"不含代码,不批准,流程结束");
            return;
        }
    }
}
